package Hello1;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class test {
    public static void main(String[] args) {
        List<String> lists=new ArrayList();
        lists.add("java");
        lists.add("sql");
        lists.add("c");

        //Iterator
        Iterator<String> it=lists.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }
        //foreach
        for (String ele:lists) {
            System.out.println(ele);
        }

        // Lambda循环

        lists.forEach(s ->{
                System.out.println(s);

        });
    }



}
